package com.gzhuxj201.mapper;

import com.gzhuxj201.entity.Class;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassMapper {

    @Select("select * from class")
    List<Class> selectAll();

    @Delete("delete from class where id=#{id}")
    int deleteById(int id);

    @Insert("insert into class(name) values(#{name})")
    int add(Class cla);

    @Select("select * from class where id=#{id}")
    Class selectById(int id);

    int update(Class cla);
}
